package SpringMVC.nota;

import java.util.Calendar;
import java.util.GregorianCalendar;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "notas")
@NamedQueries({
		@NamedQuery(name = Nota.FIND_BY_ID, query = "select n from Nota n where n.id = :id"),
		@NamedQuery(name = Nota.FIND_ALL, query = "select n from Nota n") })
public class Nota {

	public static final String FIND_BY_ID = "Nota.findById";
	public static final String FIND_ALL = "Nota.findAll";

	@Id
	@GeneratedValue
	private Long id;

	private String detalle;
	private Calendar fecha = new GregorianCalendar();

	protected Nota()
	{
		
	}
	
	public Nota(String detalle, Calendar fecha) {
		this.detalle = detalle;
		this.fecha = fecha;
	}

	public String getDetalle() {
		return detalle;
	}

	public void setDetalle(String detalle) {
		this.detalle = detalle;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Calendar getFecha() {
		return fecha;
	}

}
